<div class="col-lg-9 col-lg-offset-1">
<form class="form-horizontal" id="frm1" name="frm1" role="form" action="<?php echo $form_action; ?>" method="post">
	<div class="panel panel-default">
		<div class="panel-heading text-center"><strong><?php echo $subtitulo;?></strong></div>
		<div class="panel-body">
			
			<?php 
			if(isset($mensagem) and $mensagem != ''){
		    	echo '<div class="alert alert-warning text-center" role="alert">'.$mensagem.'</div>'; 
			}
    	
	    	if(validation_errors() != ''){
	    		echo '<div class="alert alert-danger" role="alert">';
	    		echo validation_errors();
	    		echo '</div>';
	    	}
    	?>
			    	
	
	
		<div class="form-group <?php echo (form_error('campoTitulo') != '')? 'has-error':''; ?>">
			<label for="campoTitulo" class="col-lg-2 control-label"><span style="color: red;">*</span> Título: </label> 
			<div class="col-lg-9">
			<?php echo form_input($campoTitulo); ?> 
			</div>
			<div class="col-lg-1" style="top: 5px; color: red;" id="contador"><?php echo $contador;?></div>
		</div>
		
	
		<div class="form-group <?php echo (form_error('campoData)') != '')? 'has-error':''; ?>">
			<label for="campoData" class="col-lg-2 control-label"><span style="color: red;">*</span> Data: </label> 
			<div class="col-lg-4">
			<?php echo form_input($campoData); ?>
			</div>
		</div>
	
		
		<div class="form-group <?php echo (form_error('campoRedacao') != '')? 'has-error':''; ?>">
			<label for="campoRedacao" class="col-lg-2 control-label"><span style="color: red;">*</span> Redação: </label>
			<div class="col-lg-12">
			<?php echo form_textarea($campoRedacao); ?>
			</div>
		</div>
		
		</div>
		<div class="panel-footer text-center">
			<?php 
			echo $link_cancelar . "&nbsp;"; 
			echo $link_salvar;
			?>
		</div>
	</div>
	</form>
</div>
<script>
$(function() {
	
	$('#campoTitulo').keyup(function () {
		  var max = <?php echo $contador;?>;
		  var len = $(this).val().length;
		  if (len >= max) {
		    $('#contador').text('fim');
		  } else {
		    var char = max - len;
		    $('#contador').text(char);
		  }
	});
    
	$( "#campoData" ).datepicker($.datepicker.regional[ "pt-BR" ]  );
	
});

// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'campoRedacao', {

	filebrowserBrowseUrl: 		'<?php echo base_url();?>kcfinder/browse.php?opener=ckeditor&type=files',
	filebrowserImageBrowseUrl: 	'<?php echo base_url();?>kcfinder/browse.php?opener=ckeditor&type=images',
	filebrowserFlashBrowseUrl: 	'<?php echo base_url();?>kcfinder/browse.php?opener=ckeditor&type=flash',
	filebrowserUploadUrl: 		'<?php echo base_url();?>kcfinder/upload.php?opener=ckeditor&type=files',
	filebrowserImageUploadUrl:	'<?php echo base_url();?>kcfinder/upload.php?opener=ckeditor&type=images',
	filebrowserFlashUploadUrl: 	'<?php echo base_url();?>kcfinder/upload.php?opener=ckeditor&type=flash',
   
    language: 'pt-BR',
    removeButtons: 'Save,NewPage,Print,Find,Replace,SelectAll,Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,Blockquote,CreateDiv,BidiLtr,BidiRtl,Language,Anchor,Flash,HorizontalRule,Smiley,PageBreak,Iframe,Styles,Format,About'

});

</script>
